<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="DC.Type" content="task"/>
<meta name="DC.Title" content="Editing a localized string array"/>
<meta name="abstract" content="Use the Localization Files Editor to create localized versions of text string arrays used in your applications."/>
<meta name="description" content="Use the Localization Files Editor to create localized versions of text string arrays used in your applications."/>
<meta name="DC.Relation" scheme="URI" content="../topics/t_localize-about.html"/>
<meta name="DC.Relation" scheme="URI" content="http://developer.android.com/guide/topics/resources/resources-i18n.html#best-match"/>
<meta name="DC.Relation" scheme="URI" content="../topics/r_localization-string-editor.html"/>
<meta name="DC.Relation" scheme="URI" content="../topics/t_localize-string-editing.html"/>
<meta name="DC.Relation" scheme="URI" content="../topics/t_localize-new-array-adding.html"/>
<meta name="copyright" content="Motorola, Inc. 2009-2010" type="primary"/>
<meta name="DC.Rights.Owner" content="Motorola, Inc. 2009-2010" type="primary"/>
<meta name="DC.Format" content="XHTML"/>
<meta name="DC.Identifier" content="t_localize-array-editing"/>
<meta name="DC.Language" content="en-us"/>
<link rel="stylesheet" type="text/css" href="../commonltr.css"/>
<title>Editing a localized string array</title>
</head>
<body id="t_localize-array-editing"><a name="t_localize-array-editing"><!-- --></a>
<a class="hdr-none"/>

  <h1 class="topictitle1">Editing a localized string array</h1>

  
  
  <div><p>Use the Localization Files Editor to create localized versions of text string arrays used in your
    applications.</p>

    <ol>
      <li>
        <span>Launch the Localization Files Editor using one of the following methods:</span>
        <ul>
          <li>Double-click <span class="filepath">res/values/strings.xml</span> (or any of the localized <span class="filepath">strings.xml</span> files in your project).</li>

          <li>Right-click <span class="filepath">res/values/strings.xml</span> (or any of the localized <span class="filepath">strings.xml</span> files in your project) and select <span class="menucascade"><span class="uicontrol">Open
                With</span> &gt; <span class="uicontrol">Other</span></span>. From the Editor Selection dialog, select
              <span class="uicontrol">Localization Files Editor</span> and click OK.</li>

        </ul>

         The Localization Files Editor appears, showing the base (or default) strings file and any localized
          strings files. If it does not exist, the default strings file (<samp class="codeph">values/strings.xml</samp>) will be
          created. Within the editor each column (other than the <span class="uicontrol">Key</span> column) represents a unique
          locale. Each row represents a single text string, identified by a key (string array entries are identified by
          a key that follows the pattern <em>key_nnn</em> where <em>key</em> is the actual key used to identify the array,
          and <em>nnn</em> is a numeric suffix used only within the Android Localization Files editor to uniquely identify
          that entry within the array). A cell contains the version of the row's string localized for the column's
          locale. In Android, if a given cell is blank, at runtime the operating system picks the column that best
          matches the current locale (and has a value for the row), falling back on the default string value for that
          key if necessary (the column labeled <span class="uicontrol">values</span> contains these default string values). See
          the Android documentation for a complete description of the algorithm the operating system uses to determine
          the resource file that best matches the device's current locale.
      </li>

      <li>
        <span>If desired, hide columns to simplify the editing process. </span>
         To hide a column, right-click anywhere within the Localization Files Editor table, select <span class="uicontrol">Show
            Columns</span>, and then select the column to be hidden. (Repeat this step to show a previously hidden
          column.)
      </li>

      <li>
        <span>Edit or enter text strings into the table cells as appropriate. Note that by looking across a given row you
          can see which locales have unique translations and which rely on the default string value. By looking down a
          given column you can see which strings are localized for that column's locale, and which rely on the default
          string value. Also note that you can enter multi-line string values by pressing the Return key between lines.</span>
        <ul>
          <li>To add additional entries to the array:<ol type="a">
              <li>Right-click within the Android Localization Files editor table and select <span class="uicontrol">Add
                Key</span>.</li>

              <li>From <span class="uicontrol">Add new</span> select <span class="uicontrol">Array</span>.</li>

              <li>Ensure that <span class="uicontrol">Add to array</span> is selected, then choose the array to which the
                entries are to be added from the list to the right. Finally, specify the number of entries to be added.</li>

              <li>Click <span class="uicontrol">OK</span>.</li>

            </ol>
</li>

          <li>To delete a string array, select each of the rows that makes up the array (click in the first row, and
            then while holding the shift key click in the last row to select a range), then right-click the selected
            rows and select <span class="uicontrol">Remove Key</span>.</li>

        </ul>

      </li>

      <li>
        <span>Select <span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">Save</span></span> to save your
          changes.</span>
      </li>

    </ol>

  </div>

<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/t_localize-about.html" title="Using the Localization Files Editor, you can easily create text string files for new locales, see which strings will be used in a given locale, and identify strings that have yet to be translated, all without having to work directly in XML-formatted files. It makes it easy to add new strings across multiple locales, and edit localized strings.">Localizing Text Strings</a></div>
</div>
<div class="relinfo"><strong>Related tasks</strong><br/>
<div><a href="../topics/t_localize-string-editing.html" title="Use the Localization Files Editor to create localized versions of text strings used in your applications.">Editing a localized string</a></div>
<div><a href="../topics/t_localize-new-array-adding.html" title="Create a new string array resource using the Localization Files Editor.">Adding new string arrays</a></div>
</div>
<div class="relinfo"><strong>Related reference</strong><br/>
<div><a href="../topics/r_localization-string-editor.html" title="Allows you to easily create text string files for new locales, to see which strings will be used in a given locale, and to identify strings that have yet to be translated, all without having to work directly in XML-formatted files.">Localization Files Editor</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br/>
<div><a href="http://developer.android.com/guide/topics/resources/resources-i18n.html#best-match" target="_blank">How Android finds the best matching directory</a></div>
</div>
</div>

</body>
</html>